package ar.com.personalTravellers.beans;

import com.angel.arquitectura.model.common.PersistentObject;

import javax.persistence.FetchType;
import javax.persistence.ManyToOne;
import javax.persistence.MappedSuperclass;

@MappedSuperclass
public abstract class Person extends PersistentObject{

    @ManyToOne(optional = false, fetch = FetchType.EAGER)
    private Country country;
    private String email;
    private String name;
    private String surname;
    private String telephone;


    public Person() {
        super();
    }

    public Country getCountry() {
        return country;
    }

    public void setCountry(Country country) {
        this.country = country;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSurname() {
        return surname;
    }

    public void setSurname(String surname) {
        this.surname = surname;
    }

    public String getTelephone() {
        return telephone;
    }

    public void setTelephone(String telephone) {
        this.telephone = telephone;
    }

    public String getCompleteName(){
        return this.getSurname() + ", " + this.getName();
    }
}